<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="B2B电商平台" name="description" />
<meta content="B2B电商平台" name="keyword" />

<title>B2B电商平台.交易评价统计</title>
<link rel="icon" href="include/images/icss.ico" type="image/x-icon" />
<link rel="shortcut icon" href="include/images/icss.ico"
	type="image/x-icon" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/global.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/style.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/pro.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/proManage.css" />
<link rel="stylesheet"
	href="<%=path%>/include/JQuery ui/css/smoothness/jquery-ui-1.7.3.custom.css"
	type="text/css"></link>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/pagination/page.css" media="all">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/sweetalert/sweetalert.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/css/mmt_trading.css" />

<script type="text/javascript" src="<%=path%>/include/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path%>/include/js/cookies.js"></script>
<script type="text/javascript" src="<%=path%>/include/js/icss.busin.js"></script>
<script type="text/javascript" src="<%=path%>/include/JQuery ui/js/jquery-ui-1.7.3.custom.min.js"></script>
<script type="text/javascript" src="<%=path%>/include/js/icss.common.js"></script>
<script type="text/javascript" src="<%=path%>/include/pagination/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=path%>/include/pagination/init.js"></script>
<script type="text/javascript" src="<%=path%>/include/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript" src="<%=path%>/include/sweetalert/sweetalert-dev.js"></script>




<style type="text/css">
.price a.price_rise {
	background-position: -62px -136px;
}

.price a.price_drop {
	background-position: -62px -95px;
}

.price a.price_null {
	background-position: -62px -15px;
	padding-right: 0px;
}

.expire a.expire_drops {
	background-position: -61px -95px;
}

.expire a.expire_rise {
	background-position: -61px -136px;
}

.expire a.expire_null {
	background-position: -61px -15px;
	padding-right: 0px;
}
.buytablelist td{
border: 1px solid #e1e1e1;
}
.buytablelist th{
border: 1px solid #e1e1e1;
}
</style>

<script type="text/javascript">
$(function() {
	//_reHeight("rightFrame","contentDiv");
	
	/* $("#dialogDiv").dialog({
		autoOpen : false,   // 是否自动弹出窗口
		modal : true,    // 设置为模态对话框
		resizable : true,
		width : 410,   //弹出框宽度
		height : 240,   //弹出框高度
		title : "用户登录",  //弹出框标题
		position : "center",  //窗口显示的位置
		buttons:{
			'确定':function(){
			//调用登录的方法
			},
			'取消':function(){
				$(this).dialog("close");
			},
			'取消2':function(){
				$(this).dialog("close");
			},
			'取消3':function(){
				$(this).dialog("close");
			}
		}
	});	 */
});

	/* function shouDialog(){
		$("#dialogDiv").dialog("open");
	}
	 */
	 //根据勾选评价状态，记录数值，查询详情
	function _grade(){
		var grade = $("#grade").val();
		$("#evals").val(grade);
		_queryList();
	}
	//点击列表统计数据，记录数值，查询详情
	function _queryBefore(time,eval){
		if(time=="7"){
			$("#day").html("最近1周");
		}
		if(time=="30"){
			$("#day").html("最近1个月");
		}
		if(time=="180"){
			$("#day").html("最近6个月");
		}
		if(time=="181"){
			$("#day").html("半年以前");
		}
		if(time=="182"){
			$("#day").html("所有时间");
		}
		if(time!=null&&time!=""){
			$("#days").val(time);
		}
		$("#grade option[value='"+eval+"']").attr("selected", "selected");
		$("#evals").val(eval);
		_queryList();
	}
	
	
	//处理查询条件的默认值
    //参数：id;ovalue原值;nvalue 新值; type：事件类型（1表示获取焦点 2表示失去焦点）
    /* function clearDefaultVal(id,type,ovalue,nvalue){
        if(type==1){//判断事件类型(获取焦点,情况现有默认值)
            jQuery("#"+id).val("");
        }else{
            //失去焦点，值为空，赋默认值
            if(nvalue==""){
                jQuery("#"+id).val(ovalue);
            }
        }
    } */
    //查询详情列表
    var pagination;
	function _queryList(){
		var t = $("#days").val();	//时间
		var e = $("#evals").val();	//评价状态
		var p='';	//评论内容是否勾选
		if($("#a1").attr('checked')){
			p='check';
		}else{
			p='';
		}
		var url = "<%=path%>/eval/getEvalList.do";
		var data = {
			t : t,
			e : e,
			p : p
		};
		pagination = _initPagination({'pageId':'pagination', 
			                          'url': url,
			                          'data': data, 
			                          'rows': 5, 
			                          'callback':_initDataList});
	}
	function _initDataList(data) {
		var d = data.rows;
		//var total = data.total;
		var str = "";
		$("#ajaxSerieslist").empty();
		for (var i = 0; i < d.length; i++) {
			str += "<tr>";
			str += "<td  style='text-align:left;vertical-align: middle'>";
			if (d[i].SORT_NUM == '1') {
				str += "	<span class='high1' style='padding-left: 20px;background-position: -277px -42px;'>"
						+d[i].EVAL_VAL_NAME + "</span>"+"<span style='padding-left:14px;'>"+d[i].EVAL_CONTENT+"</span>" ;
			}
			if (d[i].SORT_NUM == '2') {
				str += "	<span class='normal1' style='padding-left: 20px;background-position: -277px -74px;'>"
						+d[i].EVAL_VAL_NAME + "</span>"+"<span style='padding-left:14px;'>"+d[i].EVAL_CONTENT+"</span>" ;
			}
			if (d[i].SORT_NUM == '3') {
				str += "	<span class='low1' style='padding-left: 20px;background-position: -277px -104px;'>"
						+d[i].EVAL_VAL_NAME + "</span>"+"<span style='padding-left:14px;'>"+d[i].EVAL_CONTENT+"</span>" ;
			}
			str += "</td>";
			str += "<td style='text-align:center;vertical-align: middle' >";
			str += d[i].USER_NAME;
			str += "</td>";
			str += "<td  style='text-align:center;vertical-align: middle' >";
			str += "订单号:" + d[i].ORDER_NO;
			str += "</td>";
			str += "</tr>";
		}
		if(data.rows.length==0){
			str+="<tr style='line-height: 20px;white-space: nowrap;'>"; 		
	 		str+="<td style='text-align:center;vertical-align: middle;' colspan='4'>没有查询到相关数据</td>";
	 		str+="</tr>";
		}
		$("#ajaxSerieslist").append(str);
		//_reHeight("rightFrame", "contentDiv");
	   _reHeight();
	}
	function _reHeight(){
		var main = $(window.parent.document).find("#rightFrame");
		var mainheight = $("#contentDiv").height()+40;
		main.height(mainheight);
	}
</script>
</head>

<body style="font-family: '微软雅黑';">
	<div id="contentDiv" style="padding:4px; width:99%;">
		<div class="colnums-2-ab-b" style="overflow-x:auto;">
			<input id="days" type="hidden" value="" /> 
			<input id="evals" type="hidden" value="" />
			<input id="ifContent" type="hidden" value="" />
			<div class="toptil" style="font-size: 16px;">交易评价统计</div>
			<table cellpadding="0" cellspacing="0" width="100%" class="combtable">
				<thead>
					<tr>
						<th>评价</th>
						<th>最近1周</th>
						<th>最近1个月</th>
						<th>最近6个月</th>
						<th>半年以前</th>
						<th>总计</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${eval}" var="e">
						<tr>
							<td>
								<c:if test="${e.SORT_NUM eq '1' }">
										<span class="high" style="background-position: -277px -35px"><c:out
											value='${e.EVAL_VAL_NAME}' />（<c:out value='${e.bl}' />%）</span>
								</c:if> 
								<c:if test="${e.SORT_NUM eq '2' }">
									<span class="normal" style="background-position: -277px -66px"><c:out
											value='${e.EVAL_VAL_NAME}' />（<c:out value='${e.bl}' />%）</span>
								</c:if> 
								<c:if test="${e.SORT_NUM eq '3' }">
									<span class="low" style="background-position: -277px -97px"><c:out
											value='${e.EVAL_VAL_NAME}' />（<c:out value='${e.bl}' />%）</span>
								</c:if>
							</td>
							<td style="text-align: right;"><a
								href="javascript:void(0);" onclick="_queryBefore('7','${e.EVAL_VAL_ID}');"
								rel="nofollow"><c:out value='${e.date_7}' /></a>&nbsp;</td>
							<td style="text-align: right;"><a
								href="javascript:void(0);" onclick="_queryBefore('30','${e.EVAL_VAL_ID}');"
								rel="nofollow"><c:out value='${e.date_month}' /></a>&nbsp;</td>
							<td style="text-align: right;"><a
								href="javascript:void(0);" onclick="_queryBefore('180','${e.EVAL_VAL_ID}');"
								rel="nofollow"><c:out value='${e.date_halfyear}' /></a>&nbsp;</td>
							<td style="text-align: right;"><a
								href="javascript:void(0);" onclick="_queryBefore('181','${e.EVAL_VAL_ID}');"
								rel="nofollow"><c:out value='${e.date_halfyear_bef}' /></a>&nbsp;</td>
							<td style="text-align: right;"><a
								href="javascript:void(0);" onclick="_queryBefore('182','${e.EVAL_VAL_ID}');"
								rel="nofollow"><c:out value='${e.date_all}' /></a>&nbsp;</td>
						</tr>
					</c:forEach>

					<tr>
						<td>合计</td>
						<td style="text-align: right;"><a href="javascript:void(0);" onclick="_queryBefore('7','all');" rel="nofollow">${evalDate7All}</a>&nbsp;</td>
						<td style="text-align: right;"><a href="javascript:void(0);" onclick="_queryBefore('30','all');" rel="nofollow">${evalDateMonthyearAll}</a>&nbsp;</td>
						<td style="text-align: right;"><a href="javascript:void(0);" onclick="_queryBefore('180','all');" rel="nofollow">${evalDateHalfyearAll}</a>&nbsp;</td>
						<td style="text-align: right;"><a href="javascript:void(0);" onclick="_queryBefore('181','all');" rel="nofollow">${evalDateHalfyearBefAll}</a>&nbsp;</td>
						<td style="text-align: right;"><a href="javascript:void(0);" onclick="_queryBefore('182','all');" rel="nofollow">${evalAll}</a>&nbsp;</td>
					</tr>
				</tbody>
			</table>
			<div class="buytablelist" style="border: 0px;">
				<table cellpadding="0" cellspacing="0" width="100%" >
					<thead>
						<tr>
							<th width="33%">
								<span id="day"></span>
								 <select id="grade" name="grade" onchange="_grade();">
									 <option selected="selected" value="all">评价（全部）</option>
									 <c:forEach items="${evalGradeList}" var="evalGrade">
										<option value="<c:out value='${evalGrade.EVAL_VAL_ID}'/>">
											<c:out value='${evalGrade.EVAL_VAL_NAME}'/>
										</option>
									 </c:forEach>
								</select> 
								<span class="chkmid"> 
								<input id="a1" type="checkbox" name="hasContent" onclick="_queryList();" />
								 <label for="a1">有评论内容</label>
								</span>
							</th>
							<th width="22%" style="text-align: center;">评价人</th>
							<th width="45%" style="text-align: center;">交易信息</th>

						</tr>
					</thead>
					<tbody id="ajaxSerieslist">
					</tbody>
				</table>
				<div id="pagination"></div>
			</div>
		</div>
        
        </div>
</body>
</html>
